
#import "TSMsgTabBarController.h"
#import "TSUserViewController.h"
#import "TSSectionListViewController.h"
#import "TSTaskSearchViewController.h"
#import "TSRecieveMsgListViewController.h"
#import "TSSendMsgListViewController.h"
#import "TSAuditListViewController.h"
#import "TSTaskSearchViewController.h"
@implementation TSMsgTabBarController

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    TSRecieveMsgListViewController *finishCol = [[TSRecieveMsgListViewController alloc] init];
    TSBaseNavigationController *nav_vc_finish = [[TSBaseNavigationController alloc] initWithRootViewController:finishCol];
    
    TSSendMsgListViewController *commit_vc = [[TSSendMsgListViewController alloc] init];
    TSBaseNavigationController *nav_vc_commit = [[TSBaseNavigationController alloc] initWithRootViewController:commit_vc];
    
    TSAuditListViewController *commit_vc2 = [[TSAuditListViewController alloc] init];
    TSBaseNavigationController *nav_vc_commit2 = [[TSBaseNavigationController alloc] initWithRootViewController:commit_vc2];
    
    TSTaskSearchViewController *commit_vc3 = [[TSTaskSearchViewController alloc] init];
    TSBaseNavigationController *nav_vc_commit3 = [[TSBaseNavigationController alloc] initWithRootViewController:commit_vc3];
    
    
    self.viewControllers = @[nav_vc_finish, nav_vc_commit,nav_vc_commit2,nav_vc_commit3];
    
    NSArray *tabBarTitle = @[@"接收",@"发送",@"审核",@"查询"];
    for (NSUInteger i = 0; i < self.viewControllers.count; i++) {
        UIViewController *viewController = [self.viewControllers objectAtIndex:i];
        if ([viewController isMemberOfClass:[UINavigationController class]]) {
            viewController = [[(UINavigationController *)viewController viewControllers] firstObject];
        }
        
        if (i == 0) {
            viewController.tabBarItem = [self tabBarItemWithImage:[NSString stringWithFormat:@"nav_nor_%zd", 3] SelectedImgName:[NSString stringWithFormat:@"nav_hlr_%zd", 3]];
        }
        else{
            viewController.tabBarItem = [self tabBarItemWithImage:[NSString stringWithFormat:@"nav_nor_%zd", i] SelectedImgName:[NSString stringWithFormat:@"nav_hlr_%zd", i]];
        }
        
        viewController.tabBarItem.tag = i;
        viewController.tabBarItem.title = tabBarTitle[i];
    }

}

@end

